package com.zmn.plat.services.impl.channel;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zmn.plat.model.entity.channel.ChannelDeposit;
import com.zmn.plat.persistence.interfaces.channel.ChannelDepositDAO;
import com.zmn.plat.services.interfaces.channel.ChannelDepositService;

/**
 * 渠道押金
 *
 * @author xiangjunming
 * @since 2019 /08/19 12:14:58
 */
@Service
public class ChannelDepositServiceImpl implements ChannelDepositService {

    @Autowired
    private ChannelDepositDAO channelDepositDAO;

    @Override
    public ChannelDeposit findByKey(Integer channelId) {
        return channelDepositDAO.findByKey(channelId);
    }

    @Override
    public List<ChannelDeposit> listByChannelIds(List<Integer> channelIds) {
        return channelDepositDAO.listByChannelIds(channelIds);
    }

    @Override
    public int addBalance(Integer channelId, Integer amount) {
        return channelDepositDAO.addBalance(channelId, amount);
    }

    @Override
    public int updateByKey(ChannelDeposit record) {
        return channelDepositDAO.updateByKey(record);
    }

    @Override
    public int insert(ChannelDeposit record) {
        return channelDepositDAO.insert(record);
    }

    @Override
    public int deleteByKey(Integer channelId) {
        return channelDepositDAO.deleteByKey(channelId);
    }

    @Override
    public void copy(Integer originalChannelId, int targetChannelId, String operator) {

        channelDepositDAO.copy(originalChannelId, targetChannelId, operator);
    }
}